<h1>Listing elements</h1>

<%= will_paginate @elements %>

<table>
  <tr>
    <th>Title</th>
    <th>Description</th>
  </tr>

<% @elements.each do |element| %>
  <tr>
    <td><%=h element.title %></td>
    <td><%=h element.description %></td>
    <td><%=h element.tag_list %></td>
    <td><%= link_to 'Show', element %></td>
    <td><%= link_to 'Edit', edit_element_path(element) %></td>
    <td><%= link_to 'Destroy', element, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>


<%= "total elemets is " %>
<%= @elements.total_entries %>

<br />

<%= link_to 'New element', new_element_path %>
